<template>
  <view class="container">
    <s-nav-bar />
    <view class="container-main" flex flex-col>
      <view> setup模式：{{ test1Count }} </view>
      <view> 常规模式：{{ test2Count }} </view>
      <view class="h-20px" />
      <uv-button
        type="primary"
        text="触发Pinia"
        @click="handlePinia"
      ></uv-button>
    </view>
  </view>
</template>

<script setup>
import { storeToRefs } from "pinia";
import { useTest1Store, useTest2Store } from "@/store";

const test1Store = useTest1Store();
const { test1Count } = storeToRefs(test1Store);

const test2Store = useTest2Store();
const { test2Count } = storeToRefs(test2Store);

const handlePinia = () => {
  test1Store.setText1Count(1);
  test2Store.setText2Count(1);
};
</script>

<style lang="scss" scoped></style>
